/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package snippet.theory7;

import java.util.regex.*;

/**
 *
 * @author hoang.pt
 */
public class RegularDemo {

    /**
     * 
     * @param args
     */
    public static void main(String[] args) {
        String text = "I love b0909hv. I like c0909hv.";
        String patternString = "[^bd]0909hv";

        //init
        Pattern patternCompile = Pattern.compile(patternString, Pattern.CASE_INSENSITIVE);
        Matcher result = patternCompile.matcher(text);

        while (result.find()) {
            System.out.println(result.start());
        }
    
        //replace
        //String newText = result.replaceAll("java");
        //System.out.println(newText);



        
        
        
    }


}
